package com.app.controller;

import com.app.pojo.Teams;
import com.app.pojo.TeamsInfo;
import com.app.service.TeamsInfoService;
import com.app.service.TeamsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class TeamsInfoController {
    @Resource
    public TeamsInfoService teamsInfoService;


    //查询所有
    @RequestMapping(value = "/app19/teams/findeone",method = RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> findById(@RequestParam Integer id){
        Map<String,Object> map = new HashMap<>();
        TeamsInfo teamsInfo = teamsInfoService.findById(id);
        if(teamsInfo != null){
            map.put("success",true);
            map.put("msg","成功");
            map.put("list",teamsInfo);
        }else {
            map.put("success",false);
            map.put("msg","失败");

        }
        return map;
    }






}
